#include "ros/ros.h"
#include "sensor_msgs/LaserScan.h"

class Stopper
{
    public:
    const double FORWARD_SPEED = 0.5;
    const double FORWARD_SPEED_2 = 0.3;
    const double TURN_SPEED = -8;
    const double MIN_SCAN_ANGLE = -10/180*M_PI;
    const double MAX_SCAN_ANGLE = +10/180*M_PI;
    const float MIN_DIST_FROM_OBSTACLE = 1.5;
    Stopper();
    void startMoving();
    private:
    ros::NodeHandle node;
    ros::Publisher commandPub;
    ros::Subscriber laserSub;
    int keepMoving;
    void moveForward();
    void turn();
    void moveForward_2();
    void scanCallback(const sensor_msgs::LaserScan::ConstPtr& scan);
};